﻿<?php

class Application_Form_Carton extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
		$this->addDecorator('FormElements')        	
			->addDecorator('Form');
			
		$textTitle = new Zend_Form_Element_Text('titulo');
		$textTitle
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe el título del cartón'))
			->setLabel('Título:');
			
		$fileImage = new Zend_Form_Element_File('imagen');
		$fileImage
			->addDecorator('Label')
			->addDecorator('Description',array('escape'=>false,'tag'=>'div'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field'))
			->setAttribs(array('class'=>'cartoon-photo-input'))
			->setDescription('Recomendamos subir im&aacute;genes en formato <strong>.jpg</strong> de <strong>500 x 540</strong> pixeles.')
			->setLabel('Imagen:');						

        $submitForm = new Zend_Form_Element_Submit('submit');
		$submitForm
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','openOnly'=>true,'placement'=>'prepend'))
			->setAttribs(array('class'=>'bt blue'))
			->setDescription('<footer class="pane">')				
			->setLabel('Publicar');
			
        $resetForm = new Zend_Form_Element_Reset('reset');
		$resetForm
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','closeOnly'=>true))
			->setAttribs(array('class'=>'bt orange'))
			->setDescription('</footer>')				
			->setLabel('Limpiar');			
		
		$this->addElements( array (
			$textTitle,
			$fileImage,
			$submitForm,
			$resetForm
		));
				
    }

}